package com.blueheart.springcloud.bhitem.controller;

import com.blueheart.springcloud.bhitem.config.JdbcConfigBean;
import com.blueheart.springcloud.bhitem.pojo.Item;
import com.blueheart.springcloud.bhitem.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ItemController {


    @Autowired
    private ItemService itemService;

    @Autowired
    private JdbcConfigBean jdbcConfigBean;

    @GetMapping("/item/{id}")
    public Item queryItemById(@PathVariable("id") Long id){
        return this.itemService.queryItemById(id);
    }

    @GetMapping("/item/test")
    public String JdbcConfigBean(){
        return jdbcConfigBean.toString();
    }

}
